home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 2001 #11 / CD 11 (Black) - 2001.iso / Fruity / FRUTFOOT.DXR / 00005_ChompingGuyObj.ls < prev    next >
Encoding:
Text File  |  1998-04-13  |  6.7 KB  |  152 lines

  1. property pGuyList, pGuyTravelList, pGuyCounter, pLastGuyTime, pGuyIntervalTime, pPosInTravelList, pPreviousPosInList
  2. global gCurrentTravelProps, gGuyLocH, gGuyLocV, gEnable, gSoundCst
  3.  
  4. on new me
  5.   set pGuyList to [#rightUpright: 31, #downEyesRight: 51, #downEyesLeft: 55, #leftUpright: 35, #leftupsidedown: 39, #upEyesLeft: 43, #upEyesRight: 47]
  6.   set pGuyTravelList to [1: [#pChumpingDirection: #rightUpright, #AxisConstrain: 1, #PointConstrain: 146, #Loc1: 85, #Loc2: 169, #LocDirection: 1], 2: [#pChumpingDirection: #upEyesLeft, #AxisConstrain: 2, #PointConstrain: 168, #Loc1: 146, #Loc2: 25, #LocDirection: 2], 3: [#pChumpingDirection: #rightUpright, #AxisConstrain: 1, #PointConstrain: 20, #Loc1: 179, #Loc2: 437, #LocDirection: 1], 4: [#pChumpingDirection: #downEyesRight, #AxisConstrain: 2, #PointConstrain: 445, #Loc1: 28, #Loc2: 168, #LocDirection: 1], 5: [#pChumpingDirection: #leftUpright, #AxisConstrain: 1, #PointConstrain: 165, #Loc1: 437, #Loc2: 350, #LocDirection: 2], 6: [#pChumpingDirection: #upEyesRight, #AxisConstrain: 2, #PointConstrain: 360, #Loc1: 177, #Loc2: 69, #LocDirection: 2], 7: [#pChumpingDirection: #leftUpright, #AxisConstrain: 1, #PointConstrain: 60, #Loc1: 354, #Loc2: 240, #LocDirection: 2], 8: [#pChumpingDirection: #downEyesLeft, #AxisConstrain: 2, #PointConstrain: 235, #Loc1: 69, #Loc2: 169, #LocDirection: 1], 9: [#pChumpingDirection: #leftUpright, #AxisConstrain: 1, #PointConstrain: 168, #Loc1: 245, #Loc2: 35, #LocDirection: 2], 10: [#pChumpingDirection: #downEyesLeft, #AxisConstrain: 2, #PointConstrain: 24, #Loc1: 181, #Loc2: 290, #LocDirection: 1], 11: [#pChumpingDirection: #rightUpright, #AxisConstrain: 1, #PointConstrain: 277, #Loc1: 35, #Loc2: 173, #LocDirection: 1], 12: [#pChumpingDirection: #upEyesLeft, #AxisConstrain: 2, #PointConstrain: 165, #Loc1: 290, #Loc2: 212, #LocDirection: 2], 13: [#pChumpingDirection: #rightUpright, #AxisConstrain: 1, #PointConstrain: 198, #Loc1: 176, #Loc2: 327, #LocDirection: 1], 14: [#pChumpingDirection: #downEyesRight, #AxisConstrain: 2, #PointConstrain: 339, #Loc1: 212, #Loc2: 282, #LocDirection: 1], 15: [#pChumpingDirection: #rightUpright, #AxisConstrain: 1, #PointConstrain: 271, #Loc1: 327, #Loc2: 381, #LocDirection: 1], 16: [#pChumpingDirection: #upEyesLeft, #AxisConstrain: 2, #PointConstrain: 369, #Loc1: 284, #Loc2: 204, #LocDirection: 2], 17: [#pChumpingDirection: #rightUpright, #AxisConstrain: 1, #PointConstrain: 191, #Loc1: 381, #Loc2: 462, #LocDirection: 1]]
  7.   set pGuyCounter to 0
  8.   set pLastGuyTime to the timer
  9.   set pGuyIntervalTime to 6
  10.   set pPosInTravelList to 1
  11.   set pPreviousPosInList to 0
  12.   return me
  13. end
  14.  
  15. on mUpdateGuy me, vWhatSound
  16.   if the timer < (pLastGuyTime + pGuyIntervalTime) then
  17.     exit
  18.   end if
  19.   set gCurrentTravelProps to getAt(pGuyTravelList, pPosInTravelList)
  20.   case vWhatSound of
  21.     1:
  22.       if (pGuyCounter = 0) or (pGuyCounter = 2) then
  23.         set pGuyCounter to 1
  24.       end if
  25.       set the memberNum of sprite 40 to getaProp(pGuyList, getAt(gCurrentTravelProps, 1)) + pGuyCounter
  26.       set pGuyCounter to pGuyCounter + 2
  27.       if pGuyCounter = 5 then
  28.         set pGuyCounter to 0
  29.       end if
  30.     otherwise:
  31.       set the memberNum of sprite 40 to getaProp(pGuyList, getAt(gCurrentTravelProps, 1)) + pGuyCounter
  32.       set pGuyCounter to pGuyCounter + 1
  33.       if pGuyCounter = 4 then
  34.         set pGuyCounter to 0
  35.       end if
  36.   end case
  37.   set pLastGuyTime to the timer
  38. end
  39.  
  40. on mDragGuy me
  41.   case getAt(gCurrentTravelProps, 2) of
  42.     1:
  43.       case getAt(gCurrentTravelProps, 6) of
  44.         1:
  45.           if the mouseH >= the locH of sprite 40 then
  46.             set the loc of sprite 40 to point(the mouseH, getAt(gCurrentTravelProps, 3))
  47.             mUpdateBoxes(gBoxCoverUpManager)
  48.             if the locH of sprite 40 >= getAt(gCurrentTravelProps, 5) then
  49.               if gGuyLocH >= getAt(gCurrentTravelProps, 5) then
  50.                 exit
  51.               end if
  52.               SetGuyLocMonitor()
  53.               mNextTravelSegment(me)
  54.             end if
  55.           end if
  56.         2:
  57.           if the mouseH <= the locH of sprite 40 then
  58.             set the loc of sprite 40 to point(the mouseH, getAt(gCurrentTravelProps, 3))
  59.             mUpdateBoxes(gBoxCoverUpManager)
  60.             if the locH of sprite 40 <= getAt(gCurrentTravelProps, 5) then
  61.               if gGuyLocH <= getAt(gCurrentTravelProps, 5) then
  62.                 exit
  63.               end if
  64.               SetGuyLocMonitor()
  65.               mNextTravelSegment(me)
  66.             end if
  67.           end if
  68.       end case
  69.     2:
  70.       case getAt(gCurrentTravelProps, 6) of
  71.         1:
  72.           if the mouseV >= the locV of sprite 40 then
  73.             set the loc of sprite 40 to point(getAt(gCurrentTravelProps, 3), the mouseV)
  74.             mUpdateBoxes(gBoxCoverUpManager)
  75.             if the locV of sprite 40 >= getAt(gCurrentTravelProps, 5) then
  76.               if gGuyLocV >= getAt(gCurrentTravelProps, 5) then
  77.                 exit
  78.               end if
  79.               SetGuyLocMonitor()
  80.               mNextTravelSegment(me)
  81.             end if
  82.           end if
  83.         2:
  84.           if the mouseV <= the locV of sprite 40 then
  85.             set the loc of sprite 40 to point(getAt(gCurrentTravelProps, 3), the mouseV)
  86.             mUpdateBoxes(gBoxCoverUpManager)
  87.             if the locV of sprite 40 <= getAt(gCurrentTravelProps, 5) then
  88.               if gGuyLocV <= getAt(gCurrentTravelProps, 5) then
  89.                 exit
  90.               end if
  91.               SetGuyLocMonitor()
  92.               mNextTravelSegment(me)
  93.             end if
  94.           end if
  95.       end case
  96.   end case
  97. end
  98.  
  99. on mNextTravelSegment me
  100.   case pPosInTravelList of
  101.     17:
  102.       mWinAnim(me)
  103.       repeat with n = 1 to 40
  104.         set the loc of sprite n to point(1000, 1000)
  105.       end repeat
  106.       updateStage()
  107.       if IsShockWave() then
  108.         gotoNetPage("../ffxgu.html")
  109.         abort()
  110.       else
  111.         if IsProj() then
  112.           go(1, "GUSHERS")
  113.         else
  114.           resetGame()
  115.         end if
  116.       end if
  117.       abort()
  118.   end case
  119.   set pPreviousPosInList to pPosInTravelList
  120.   set pPosInTravelList to pPosInTravelList + 1
  121. end
  122.  
  123. on mWinAnim me
  124.   puppetSound(0)
  125.   set gSoundCst to 0
  126.   updateStage()
  127.   set blank to 78
  128.   puppetSound(1, 19)
  129.   set gSoundCst to 19
  130.   updateStage()
  131.   set the stretch of sprite 7 to 0
  132.   set the stretch of sprite 8 to 0
  133.   repeat while soundBusy(1)
  134.     set theTime to the timer + 8
  135.     set the memberNum of sprite 7 to 73
  136.     set the memberNum of sprite 8 to 74
  137.     set the memberNum of sprite 9 to 76
  138.     UStage(theTime)
  139.     set theTime to the timer + 8
  140.     set the memberNum of sprite 9 to 77
  141.     UStage(theTime)
  142.     set theTime to the timer + 8
  143.     set the memberNum of sprite 7 to blank
  144.     set the memberNum of sprite 8 to blank
  145.     set the memberNum of sprite 9 to 76
  146.     UStage(theTime)
  147.     set theTime to the timer + 8
  148.     set the memberNum of sprite 9 to 75
  149.     UStage(theTime)
  150.   end repeat
  151. end
  152.